#include "voda.h"
#include "console_io.h"

#include <iostream>

namespace voda
{
	boost::shared_ptr<console_io> console_io::create (boost::function<void(console_io*)> const & deleter)
	{
		if (deleter) {
			return boost::shared_ptr<console_io> (new console_io, deleter);
		}
		else {
			return boost::shared_ptr<console_io> (new console_io);
		}
	}

	console_io::console_io (void)
	{
	}

	console_io::~console_io (void)
	{
	}

	void console_io::out (std::string const & msg)
	{
		std::cout << msg << std::endl;
	}

	void console_io::err (std::string const & err)
	{
		std::cerr << err << std::endl;
	}

	bool console_io::in (std::string & txt)
	{
		std::cin >> txt;
		return true;
	}
}